package top.yxqz.spring.ioc.util;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author: 余小小
 * @date: 2023/4/7
 * @description： 后置处理器
 */
public class YxqzBeanPostProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("当前Bean的名称是(Before)：" + beanName);
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("当前Bean的名称是(After)：" + beanName);
        return bean;
    }
}
